package java9;

import java.util.Scanner;

public class Code122 {
	public static void main(String[] args) {
		int m=0;
		Scanner input=new Scanner(System.in);
		String a="y";
		for(int i=1;i<5;i++){
			System.out.println("欢迎来到第"+i+"家店");
			for(int j=1;j>0;j++){
				System.out.println("是否离开！(y/n)");
				String b=input.next();
				if(b.equals(a)){
					break;
				}
				System.out.println("买了一件衣服！");
				m++;
			}
			System.out.println("结账成功！");
		}
		System.out.println("一共买了"+m+"件衣服！");
	}
}
